package com.jxs.android.cmcc;

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.jxs.android.util.FileHloder;
import com.jxs.android.util.StartHelper;

public class Welcome extends Activity implements AnimationListener {
	public Welcome() {
		FileHloder.createDir();
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.bu_welcome);
	}

	@Override
	protected void onResume() {
		super.onResume();
		ImageView imageView = (ImageView) findViewById(R.id.welcome_icould);
		Animation alphaAnimation = AnimationUtils.loadAnimation(this, R.anim.welcome_alpha);
		alphaAnimation.setFillEnabled(true); // 启动Fill保持
		alphaAnimation.setFillAfter(true); // 设置动画的最后一帧是保持在View上面
		imageView.setAnimation(alphaAnimation);
		alphaAnimation.setAnimationListener(this);
	}

	@Override
	public void onAnimationStart(Animation paramAnimation) {

	}

	@Override
	public void onAnimationEnd(Animation paramAnimation) {
		StartHelper.startActivity(Login.class);
		this.finish();
	}

	@Override
	public void onAnimationRepeat(Animation paramAnimation) {

	}

}